package com.itheima.d0_integer;

public class Demo {
    public static void main(String[] args) {
        //装箱：基本类型变成包装类型
        Integer i1 = new Integer(100);//过时
        System.out.println("i1 = " + i1);

        Integer i2 = Integer.valueOf(100);
        //自动装箱：基本类型可以直接转换为包装类型
        Integer i3 = 100;

        //自动拆箱： 包装类型直接转换为基本类型
        int i4 = i3;
        System.out.println("i4 = " + i4);

        Integer a = 10;
        int b = 20;
        Integer c = a + b;//完成自动的装箱和拆箱
        System.out.println("c = " + c);
    }
}
